package com.study.common.util;

import com.study.common.result.Result;
import com.study.common.result.ResultEnums;

/**
 * 返回工具类
 */
public class ResultUtil {

    public static Result success() {
        return success(ResultEnums.SUCCESS);
    }

    public static Result success(Object obj) {
        return new Result(ResultEnums.SUCCESS, obj);
    }

    public static Result success(ResultEnums enums) {
        return new Result(enums, null);
    }

    public static Result success(ResultEnums enums, Object obj) {
        return new Result(enums, obj);
    }

    public static Result error(Integer code, String msg) {
        return new Result(code, msg);
    }

    public static Result error(String msg) {
        return error(-1, msg);
    }

}
